<?php
	define("IN_WEB",true);
	session_start();
	ini_set('session.gc_maxlifetime',90*60);
	ini_set('session.cookie_lifetime',90*60);
	header ("Content-Type: text/html; charset=utf8");
	include("includes/initadmin.php");
	$password = md5($_POST["password"]);  //密码
    $username = $_POST["username"];       //用户名

	$query = "SELECT * FROM $TBL_USERS WHERE user_name='$username' AND user_password='$password'";
	$result = mysql_query($query) or die(mysql_error());
	if(mysql_num_rows($result)>0)
	{
		$array=mysql_fetch_array($result);
		$_SESSION['user_id']=$array["user_id"];
		$_SESSION['user_type']=$array["user_type"];
		$_SESSION['permission']=$array["permission"];
		$_SESSION['name']=$array["user_realname"];
		MyNotice("登錄成功",2,"$conf[base_url]index.php");
		exit(0);
	}
	else
	{
		MyNotice("用戶名或密碼錯誤",2,"$conf[base_url]login.php");
		exit(0);
	}

?>
